package org.example.game.history;


/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/07/28 11:03
 */
public class Solution4083 {

    public int numberOfSubstrings(String s) {
        int count1 = 0;
        int count0 = 0;

        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1'){
                count1++;
            }else {
                count0++;
            }
        }

        int sum = 0;
        if(count1 > count0){
            sum = find0(s, count0);
        }else {
            sum = find1(s, count1);
        }
        return sum;
    }

    private int find0(String s, int count0) {
        int sum = 0;

        return s.length() * (s.length()+1)/2 - sum;
    }

    private int find1(String s, int count1) {
        int sum = 0;
        int[] index1 = new int[count1];
        int index = 0;
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == '1'){
                index1[index] = i;
                index++;
            }
        }
        //
        for(int i=1;i<=count1;i++){

        }
        return sum;
    }

}
